package com.unittec.zk.provider.utils;

import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Date;

/**
 *
 * @Description:
 * @author: chenjiawang
 * @CreateDate: 2019/12/10 9:14
 */
public class T {
    public static String nvl(String val1, String val2) {
        if (StringUtils.isBlank(val1)) {
            return val2;
        }
        return val1;
    }

    public static BigDecimal nvl(BigDecimal val1, BigDecimal val2) {
        if (val1 == null) {
            return val2;
        }
        return val1;
    }

    public static Date nvl(Date val1, Date val2) {
        if (val1 == null) {
            return val2;
        }
        return val1;
    }

    public static Integer nvl(Integer val1, Integer val2) {
        if (val1 == null) {
            return val2;
        }
        return val1;
    }
}
